package com.yilin.tms.core.entity.system.system;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Entity
@Table(name = "sys_function_api")
@TableName("sys_function_api")
public class FunctionApi extends BaseEntity {
    public enum ApiType {
        catalogue(0,"目录"),functionApi(1, "接口API");
        @EnumValue
        public int index;
        public String name;
        ApiType(int index, String name) {
            this.index = index;
            this.name = name;
        }
    }
    @Column(name = "code")
    private String code;//唯一码
    @Column(name = "layer")
    private Integer layer;
    @Column(name = "api_type")
    private ApiType apiType;
    @Column(name = "name")
    private String name;
    @Column(name = "introduce")
    private String introduce;
    @Column(name = "parent_id")
    private String parentId;

    @Column(name = "remark")
    private String remark;
    @Column(name = "soft")
    private Integer soft = 0; //排序

    // ##该接口允许访问的用户类型
    @Column(name = "target_user_types")
    private String targetUserTypes;

    // ### 查询字段：
    @Transient
    @TableField(exist = false)
    private List<Object> checkArr;//用户前台checkbox勾选状态

    public String getTargetUserTypes() {
        return targetUserTypes;
    }

    public void setTargetUserTypes(String targetUserTypes) {
        this.targetUserTypes = targetUserTypes;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getSoft() {
        return soft;
    }

    public void setSoft(Integer soft) {
        this.soft = soft;
    }

    public List<Object> getCheckArr() {
        return checkArr;
    }

    public void setCheckArr(List<Object> checkArr) {
        this.checkArr = checkArr;
    }

    public Integer getLayer() {
        return layer;
    }

    public void setLayer(Integer layer) {
        this.layer = layer;
    }

    public ApiType getApiType() {
        return apiType;
    }

    public void setApiType(ApiType apiType) {
        this.apiType = apiType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
